<template>
  <el-empty class="pf-table">
    <h1>您要找的页面走失了!!!</h1>
    <el-button @click="backHome">回首页</el-button>
  </el-empty>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue';
import { useRoute } from 'vue-router';
import router from '@/router';
import { Constants } from '@/constants/constants';
import store from '@/store';

export default defineComponent({
  name: 'Table',
  setup() {
    // const route = useRoute();
    const isCollapse = ref(false);
    const backHome = () => {
      store
        .dispatch('menus/initMenusByAppId')
        .then(() => {
          const homePageCode = store.getters['menus/index'].menuCode;
          router.replace({ name: homePageCode });
        })
        .catch(err => {
          throw new Error('获取用户和菜单失败:' + err);
        });
    };
    return { isCollapse, backHome };
  }
});
</script>
<style scoped lang="scss">
.#{$prefix} {
  &-table {
  }
}
</style>
